Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Repoint cc dep in bootstrap to its latest version. #134344

Closed
wants to merge 2 commits into from

Conversation

lasiotus
Copy link

@lasiotus lasiotus commented Dec 15, 2024

v1.2.4 handles new/unofficial targets much better than v1.2.0.

More specifically, v1.2.4 allows using env vars to pass target parameters to cc crate, as discussed in rust-lang/cc-rs#1317. With v1.2.0, unofficial targets like Motor OS cannot easily rebase to the current rust-lang and have to stay at an older version.

Also bump cmake's version from 0.1.48 to 0.1.52, as it is linked to cc.

cc-rs changelogs:

1.2.4
1.2.3
1.2.2
1.2.1

cmake changelogs/releases:

0.1.52
0.1.51
0.1.50: not a release
0.1.49

v1.2.4 handles new/unofficial targets much better than v1.2.0.

Also bump cmake's version, as it is linked to cc.
@rustbot
Copy link
Collaborator

rustbot commented Dec 15, 2024

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @jieyouxu (or someone else) some time within the next two weeks.

Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

  • @rustbot author: the review is finished, PR author should check the comments and take action accordingly
  • @rustbot review: the author is ready for a review, this PR will be queued again in the reviewer's queue

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Dec 15, 2024
@jieyouxu
Copy link
Member

@lasiotus could you link to the relnotes for cc and cmake between

  • cc = "=1.2.0" and cc = "=1.2.4"
  • cmake = "=0.1.48" and cmake = "=0.1.52"

in the PR description? That way, (1) I have some clue what these bumps entail and (2) if something regresses, we are more likely to know which changes are responsible.

As you may have noticed, we pin these since

# Most of the time updating these dependencies requires modifications to the
# bootstrap codebase(e.g., https://github.com/rust-lang/rust/issues/124565);
# otherwise, some targets will fail. That's why these dependencies are explicitly pinned.

v1.2.4 handles new/unofficial targets much better than v1.2.0.

Can you elaborate on which targets (please also just include that info in PR description for git archaeology purposes)?

@rustbot author

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 15, 2024
@jieyouxu
Copy link
Member

You know what, let's just see what breaks.

@bors r+ rollup=never

@bors
Copy link
Contributor

bors commented Dec 15, 2024

📌 Commit f396e87 has been approved by jieyouxu

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Dec 15, 2024
@lasiotus
Copy link
Author

@lasiotus could you link to the relnotes for cc and cmake between

  • cc = "=1.2.0" and cc = "=1.2.4"
  • cmake = "=0.1.48" and cmake = "=0.1.52"

in the PR description? That way, (1) I have some clue what these bumps entail and (2) if something regresses, we are more likely to know which changes are responsible.

As you may have noticed, we pin these since

# Most of the time updating these dependencies requires modifications to the
# bootstrap codebase(e.g., https://github.com/rust-lang/rust/issues/124565);
# otherwise, some targets will fail. That's why these dependencies are explicitly pinned.

v1.2.4 handles new/unofficial targets much better than v1.2.0.

Can you elaborate on which targets (please also just include that info in PR description for git archaeology purposes)?

@rustbot author

Done.

@clubby789
Copy link
Contributor

FYI, a cc update to 1.2.4 (most likely) was the culprit for a failure here

@jieyouxu
Copy link
Member

Thanks!

@jieyouxu
Copy link
Member

Let's see if it's still a problem.

@NobodyXu
Copy link
Contributor

1.2.2 - 2024-11-29

Fetch target info from Cargo even if Build::target is manually set (#1299)

Based on the changelog, I believe 1.2.2 is the first release that allows using env vars to pass target parameters to cc crate

bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 16, 2024
Repoint cc dep in bootstrap to its latest version.

v1.2.4 handles new/unofficial targets much better than v1.2.0.

More specifically, v1.2.4 allows using env vars to pass target parameters to cc crate, as discussed in rust-lang/cc-rs#1317. With v1.2.0, unofficial targets like [Motor OS](https://github.com/moturus/motor-os) [cannot](moturus/motor-os#18) easily rebase to the current rust-lang and have to stay at an [older version](https://github.com/moturus/rust/tree/motor-os_2024-10-18).

Also bump cmake's version from 0.1.48 to 0.1.52, as it is linked to cc.

cc-rs changelogs:

[1.2.4](https://github.com/rust-lang/cc-rs/blob/main/CHANGELOG.md#121---2024-11-14)
[1.2.3](https://github.com/rust-lang/cc-rs/blob/main/CHANGELOG.md#123---2024-12-06)
[1.2.2](https://github.com/rust-lang/cc-rs/blob/main/CHANGELOG.md#122---2024-11-29)
[1.2.1](https://github.com/rust-lang/cc-rs/blob/main/CHANGELOG.md#121---2024-11-14)

cmake changelogs/releases:

[0.1.52](https://github.com/rust-lang/cmake-rs/blob/master/CHANGELOG.md#0152---2024-11-25)
[0.1.51](https://github.com/rust-lang/cmake-rs/blob/master/CHANGELOG.md#0151---2024-08-15)
0.1.50: not a release
[0.1.49](https://github.com/rust-lang/cmake-rs/releases/tag/0.1.49)
@bors
Copy link
Contributor

bors commented Dec 16, 2024

⌛ Testing commit f396e87 with merge 1a0bdd7...

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Dec 16, 2024

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Dec 16, 2024
@jieyouxu jieyouxu added the CI-spurious-fail-msvc CI spurious failure: target env msvc label Dec 16, 2024
@jieyouxu
Copy link
Member

No, that is not the failure I was expecting.
@bors retry (msvc usual something holding on to file problem)

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 16, 2024
@bors
Copy link
Contributor

bors commented Dec 16, 2024

⌛ Testing commit f396e87 with merge e2494ec...

@clubby789
Copy link
Contributor

Going to try and look into this today with #134558

bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 20, 2024
[EXPERIMENTAL] Bisect cmake bootstrap issue

r? `@ghost`
Investigating rust-lang#134344
try-job: dist-apple-various
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 20, 2024
[EXPERIMENTAL] Bisect cmake bootstrap issue

r? `@ghost`
Investigating rust-lang#134344
try-job: dist-apple-various
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 20, 2024
[EXPERIMENTAL] Bisect cmake bootstrap issue

r? `@ghost`
Investigating rust-lang#134344
try-job: dist-apple-various
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 20, 2024
[EXPERIMENTAL] Bisect cmake bootstrap issue

r? `@ghost`
Investigating rust-lang#134344
try-job: dist-apple-various
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 20, 2024
[EXPERIMENTAL] Bisect cmake bootstrap issue

r? `@ghost`
Investigating rust-lang#134344
try-job: dist-apple-various
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 21, 2024
[EXPERIMENTAL] Bisect cmake bootstrap issue

r? `@ghost`
Investigating rust-lang#134344
try-job: dist-apple-various
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 21, 2024
[EXPERIMENTAL] Bisect cmake bootstrap issue

r? `@ghost`
Investigating rust-lang#134344
try-job: dist-apple-various
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 21, 2024
[EXPERIMENTAL] Bisect cmake bootstrap issue

r? `@ghost`
Investigating rust-lang#134344
try-job: dist-apple-various
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 21, 2024
[EXPERIMENTAL] Bisect cmake bootstrap issue

r? `@ghost`
Investigating rust-lang#134344
try-job: dist-apple-various
@clubby789
Copy link
Contributor

Details in the PR, but current status is that rust-lang/cmake-rs@d668808 regressed, as we don't provide CMAKE_SYSTEM_NAME on iOS. Further investigation from someone with a Mac would be appreciated

@stefson
Copy link

stefson commented Jan 19, 2025

I would like to test this pullrequest, but I'm using the beta-rustc tarball and need to use the offline mode on my distro. Is there an established way to integrate an updated crate src dir into the source tarballs? I already downloaded the cc and cmake sources from crates.io and copied them into the vendor dir, but they lack checksums and I guess the Cargo.lock file to be picked up. Thanks

In any case: the future fix should be uplifted to the 1.85.0_beta branch, my custom target is broken.

@jieyouxu jieyouxu added the E-help-wanted Call for participation: Help is requested to fix this issue. label Jan 20, 2025
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 2, 2025
[EXPERIMENTAL] bootstrap: bump cc to 1.2.11 and cmake to 0.1.53

Alright, what fails now?

Previous bump attempt: rust-lang#134344

r? `@ghost`

try-job: dist-apple-various
@jieyouxu
Copy link
Member

jieyouxu commented Feb 2, 2025

I would like to test this pullrequest, but I'm using the beta-rustc tarball and need to use the offline mode on my distro. Is there an established way to integrate an updated crate src dir into the source tarballs? I already downloaded the cc and cmake sources from crates.io and copied them into the vendor dir, but they lack checksums and I guess the Cargo.lock file to be picked up. Thanks

I believe you can edit bootstrap's Cargo.toml's cc and cmake deps to use a path dependency to local cc and cmake sources.

@jieyouxu
Copy link
Member

jieyouxu commented Feb 2, 2025

I tried another bump separately, and seems like we're running into rust-lang/cc-rs#1383

@madsmtm
Copy link
Contributor

madsmtm commented Feb 3, 2025

Fix for the cc-rs issue in rust-lang/cc-rs#1384, will likely be out on next Friday.

@clubby789
Copy link
Contributor

clubby789 commented Feb 3, 2025

Can we try using the version from Git in a try build and see if that fixes the bootstrap process?

@rustbot
Copy link
Collaborator

rustbot commented Feb 12, 2025

There are merge commits (commits with multiple parents) in your changes. We have a no merge policy so these commits will need to be removed for this pull request to be merged.

You can start a rebase with the following commands:

$ # rebase
$ git pull --rebase https://github.com/rust-lang/rust.git master
$ git push --force-with-lease

The following commits are merge commits:

@rustbot rustbot added the has-merge-commits PR has merge commits, merge with caution. label Feb 12, 2025
@lasiotus
Copy link
Author

This is not moving, closing until later.

@lasiotus lasiotus closed this Feb 12, 2025
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 15, 2025
…<try>

Bump bootstrap cc to 1.2.14 and cmake to 0.1.54

## Summary

Bump bootstrap's `cc` and `cmake` deps:

1. To make it easier to add new/unofficial targets. In particular, `cc` v1.2.4+ allows using env vars to pass target parameters to the `cc` crate. This was previously attempted in rust-lang#134344 but ran into macos-cross-to-iOS problems with `cmake` (and also rust-lang#136440, rust-lang#136720). See also discussions in rust-lang/cc-rs#1317.
2. Fix some flag inheritance warnings. Fixes rust-lang#136338.

## `cc` changelogs between `1.2.0` and `1.2.14`

> ## [1.2.14](rust-lang/cc-rs@cc-v1.2.13...cc-v1.2.14) - 2025-02-14
>
> ### Other
>
> - Regenerate target info ([rust-lang#1398](rust-lang/cc-rs#1398))
> - Add support for setting `-gdwarf-{version}` based on RUSTFLAGS ([rust-lang#1395](rust-lang/cc-rs#1395))
> - Add support for alternative network stack io-sock on QNX 7.1 aarch64 and x86_64 ([rust-lang#1312](rust-lang/cc-rs#1312))
>
> ## [1.2.13](rust-lang/cc-rs@cc-v1.2.12...cc-v1.2.13) - 2025-02-08
>
> ### Other
>
> - Fix cross-compiling for Apple platforms ([rust-lang#1389](rust-lang/cc-rs#1389))
>
> ## [1.2.12](rust-lang/cc-rs@cc-v1.2.11...cc-v1.2.12) - 2025-02-04
>
> ### Other
>
> - Split impl Build ([rust-lang#1382](rust-lang/cc-rs#1382))
> - Don't specify both `-target` and `-mtargetos=` on Apple targets ([rust-lang#1384](rust-lang/cc-rs#1384))
>
> ## [1.2.11](rust-lang/cc-rs@cc-v1.2.10...cc-v1.2.11) - 2025-01-31
>
> ### Other
>
> - Fix more flag inheritance ([rust-lang#1380](rust-lang/cc-rs#1380))
> - Include wrapper args. in `stdout` family heuristics to restore classifying `clang --driver-mode=cl` as `Msvc { clang_cl: true }` ([rust-lang#1378](rust-lang/cc-rs#1378))
> - Constrain `-Clto` and `-Cembed-bitcode` flag inheritance to be `clang`-only ([rust-lang#1379](rust-lang/cc-rs#1379))
> - Pass deployment target with `-m*-version-min=` ([rust-lang#1339](rust-lang/cc-rs#1339))
> - Regenerate target info ([rust-lang#1376](rust-lang/cc-rs#1376))
>
> ## [1.2.10](rust-lang/cc-rs@cc-v1.2.9...cc-v1.2.10) - 2025-01-17
>
> ### Other
>
> - Fix CC_FORCE_DISABLE=0 evaluating to true ([rust-lang#1371](rust-lang/cc-rs#1371))
> - Regenerate target info ([rust-lang#1369](rust-lang/cc-rs#1369))
> - Make hidden lifetimes explicit. ([rust-lang#1366](rust-lang/cc-rs#1366))
>
> ## [1.2.9](rust-lang/cc-rs@cc-v1.2.8...cc-v1.2.9) - 2025-01-12
>
> ### Other
>
> - Don't pass inherited PGO flags to GNU compilers (rust-lang#1363)
> - Adjusted zig cc judgment and avoided zigbuild errors([rust-lang#1360](rust-lang/cc-rs#1360)) ([rust-lang#1361](rust-lang/cc-rs#1361))
> - Fix compilation on macOS using clang and fix compilation using zig-cc ([rust-lang#1364](rust-lang/cc-rs#1364))
>
> ## [1.2.8](rust-lang/cc-rs@cc-v1.2.7...cc-v1.2.8) - 2025-01-11
>
> ### Other
>
> - Add `is_like_clang_cl()` getter (rust-lang#1357)
> - Fix clippy error in lib.rs ([rust-lang#1356](rust-lang/cc-rs#1356))
> - Regenerate target info ([rust-lang#1352](rust-lang/cc-rs#1352))
> - Fix compiler family detection issue with clang-cl on macOS ([rust-lang#1328](rust-lang/cc-rs#1328))
> - Update `windows-bindgen` dependency ([rust-lang#1347](rust-lang/cc-rs#1347))
> - Fix clippy warnings ([rust-lang#1346](rust-lang/cc-rs#1346))
>
> ## [1.2.7](rust-lang/cc-rs@cc-v1.2.6...cc-v1.2.7) - 2025-01-03
>
> ### Other
>
> - Regenerate target info ([rust-lang#1342](rust-lang/cc-rs#1342))
> - Document new supported architecture names in windows::find
> - Make is_flag_supported_inner take an &Tool ([rust-lang#1337](rust-lang/cc-rs#1337))
> - Fix is_flag_supported on msvc ([rust-lang#1336](rust-lang/cc-rs#1336))
> - Allow using Visual Studio target names in `find_tool` ([rust-lang#1335](rust-lang/cc-rs#1335))
>
> ## [1.2.6](rust-lang/cc-rs@cc-v1.2.5...cc-v1.2.6) - 2024-12-27
>
> ### Other
>
> - Don't inherit the `/Oy` flag for 64-bit targets ([rust-lang#1330](rust-lang/cc-rs#1330))
>
> ## [1.2.5](rust-lang/cc-rs@cc-v1.2.4...cc-v1.2.5) - 2024-12-19
>
> ### Other
>
> - Check linking when testing if compiler flags are supported ([rust-lang#1322](rust-lang/cc-rs#1322))
>
> ## [1.2.4](rust-lang/cc-rs@cc-v1.2.3...cc-v1.2.4) - 2024-12-13
>
> ### Other
>
> - Add support for C/C++ compiler for Neutrino QNX: `qcc` ([rust-lang#1319](rust-lang/cc-rs#1319))
> - use -maix64 instead of -m64 ([rust-lang#1307](rust-lang/cc-rs#1307))
>
> ## [1.2.3](rust-lang/cc-rs@cc-v1.2.2...cc-v1.2.3) - 2024-12-06
>
> ### Other
>
> - Improve detection of environment when compiling from msbuild or msvc ([rust-lang#1310](rust-lang/cc-rs#1310))
> - Better error message when failing on unknown targets ([rust-lang#1313](rust-lang/cc-rs#1313))
> - Optimize RustcCodegenFlags ([rust-lang#1305](rust-lang/cc-rs#1305))
>
> ## [1.2.2](rust-lang/cc-rs@cc-v1.2.1...cc-v1.2.2) - 2024-11-29
>
> ### Other
>
> - Inherit flags from rustc ([rust-lang#1279](rust-lang/cc-rs#1279))
> - Add support for using sccache wrapper with cuda/nvcc ([rust-lang#1304](rust-lang/cc-rs#1304))
> - Fix msvc stdout not shown on error ([rust-lang#1303](rust-lang/cc-rs#1303))
> - Regenerate target info ([rust-lang#1301](rust-lang/cc-rs#1301))
> - Fix compilation of C++ code for armv7-unknown-linux-gnueabihf ([rust-lang#1298](rust-lang/cc-rs#1298))
> - Fetch target info from Cargo even if `Build::target` is manually set ([rust-lang#1299](rust-lang/cc-rs#1299))
> - Fix two files with different extensions having the same object name ([rust-lang#1295](rust-lang/cc-rs#1295))
> - Allow disabling cc's ability to compile via env var CC_FORCE_DISABLE ([rust-lang#1292](rust-lang/cc-rs#1292))
> - Regenerate target info ([rust-lang#1293](rust-lang/cc-rs#1293))
>
> ## [1.2.1](rust-lang/cc-rs@cc-v1.2.0...cc-v1.2.1) - 2024-11-14
>
> ### Other
>
> - When invoking `cl -?`, set stdin to null ([rust-lang#1288](rust-lang/cc-rs#1288))

## `cmake` changelogs `0.1.51` to `0.1.54`

> ## [0.1.54](rust-lang/cmake-rs@v0.1.53...v0.1.54) - 2025-02-10
>
> ### Other
>
> - Remove workaround for broken `cc-rs` versions ([rust-lang#235](rust-lang/cmake-rs#235))
> - Be more precise in the description of `register_dep` ([rust-lang#238](rust-lang/cmake-rs#238))
>
> ## [0.1.53](rust-lang/cmake-rs@v0.1.52...v0.1.53) - 2025-01-27
>
> ### Other
>
> - Disable broken Make jobserver support on OSX to fix parallel builds ([rust-lang#229](rust-lang/cmake-rs#229))
>
> ## [0.1.52](rust-lang/cmake-rs@v0.1.51...v0.1.52) - 2024-11-25
>
> ### Other
>
> - Expose cc-rs no_default_flags for hassle-free cross-compilation ([rust-lang#225](rust-lang/cmake-rs#225))
> - Add a `success` job to CI
> - Change `--build` to use an absolute path
> - Merge pull request [rust-lang#195](rust-lang/cmake-rs#195) from meowtec/feat/improve-fail-hint
> - Improve hint for cmake not installed in Linux (code 127)
>
> ## [0.1.51](rust-lang/cmake-rs@v0.1.50...v0.1.51) - 2024-08-15
>
> ### Added
>
> - Add JOM generator support ([rust-lang#183](rust-lang/cmake-rs#183))
> - Improve visionOS support ([rust-lang#209](rust-lang/cmake-rs#209))
> - Use `Generic` for bare-metal systems ([rust-lang#187](rust-lang/cmake-rs#187))
>
> ### Fixed
>
> - Fix cross compilation on android armv7 and x86 ([rust-lang#186](rust-lang/cmake-rs#186))

try-job: dist-apple-various
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI-spurious-fail-msvc CI spurious failure: target env msvc E-help-wanted Call for participation: Help is requested to fix this issue. has-merge-commits PR has merge commits, merge with caution. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants